package com.ncloud.crm.mapper;

import org.apache.ibatis.annotations.*;

import com.ncloud.crm.entity.order.WorkNodeAttr;

import java.util.List;

/**
 * Created by shiqiang on 2017/4/11.
 */
@Mapper
public interface WorkNodeAttrMapper {
    @Select(value = { "select * from bs_o_work_node_attr where work_id = #{workId}" })
    @Results({ @Result(column = "work_id", property = "workId"), @Result(column = "modify_tag", property = "modifyTag"),
            @Result(column = "node_id", property = "nodeId"),
            @Result(column = "attr_id", property = "attrId"),@Result(column = "attr_type", property = "attrType"),
            @Result(column="attr_code",property="attrCode"),@Result(column="attr_value",property="attrValue"),
            @Result(column="begin_date",property="beginDate"),@Result(column="end_date",property="endDate")
    })
    public List<WorkNodeAttr> getWorkNodeAttrByWorkId(Long workId);
    @Insert(value = "insert into bs_o_work_node_attr(work_id,modify_tag,node_id,attr_type,attr_code,attr_value,begin_date,end_date,attr_id) " +
            "values(#{workId},#{modifyTag},#{nodeId},#{attrType},#{attrCode},#{attrValue},#{beginDate},#{endDate},#{attrId})")
    public int insertWorkNodeAttr(WorkNodeAttr workAttr);
}
